{% extends "base.html" %}

{% block title %}{{ item.name|escape }} (edit){% endblock %}

{% block body %}
<div class="content">
	<h1><a href="{{ path_prefix }}/v/{{ item.name|uurlencode }}">{{ item.name|escape }}</a></h1>
	<form method="post" action="{{ path }}">
		<input type="hidden" name="key" value="{{ item.key|escape }}"/>
		<table>
			<tbody>
				<tr>
					<th>Name:</th>
					<td><input type="text" name="name" value="{{ item.name|escape }}"/></td>
				</tr>
				<tr>
					<th>Description:</th>
					<td><textarea name="description">{% if item.description %}{{ item.description|escape }}{% endif %}</textarea></td>
				</tr>
				<tr>
					<th>Categories:</th>
					<td><textarea name="categories">{{ item.categories|listarea }}</textarea></td>
				</tr>
				<tr>
					<th>Links:</th>
					<td><textarea name="links">{{ item.links|listarea }}</textarea></td>
				</tr>
				<tr>
					<th>Picture URL:</th>
					<td><input type="text" name="picture" value="{% if item.picture %}{{ item.picture|escape }}{% endif %}"/></td>
				</tr>
				<tr>
					<th/>
					<td><button>Save</button> or <a href="{{ path_prefix }}/v/{{ item.name|uurlencode }}">cancel</a></td>
				</tr>
			</tbody>
		</table>
	</form>
</div>
{% endblock %}
